VERSION=0.7.59
echo getting nginx $VERSION
sudo wget http://sysoev.ru/nginx/nginx-$VERSION.tar.gz
sudo tar xvfz nginx-$VERSION.tar.gz
cd nginx-$VERSION
sudo ./configure
sudo make
sudo make install

echo To make things more "debianish", we have also created a\
       'sites-enabled' and 'sites-available' folder

cd /usr/local/nginx/conf
sudo mkdir sites-enabled
sudo mkdir sites-available

echo symlinking /user/local/nginx/conf to /etc/nginx
 sudo ln -s /usr/local/nginx/conf /etc/nginx

echo adding proxy.conf file

wget http://splashstartplone.googlecode.com/hg/config-files/trunk/proxy.conf -O /etc/nginx/proxy.conf

echo adding the site-management scripts nginxensite and nginxdissite

sudo wget http://splashstartplone.googlecode.com/hg/config-files/trunk/scripts/nginxensite -O /usr/sbin/nginxensite
sudo wget http://splashstartplone.googlecode.com/hg/config-files/trunk/scripts/nginxdissite -O /usr/sbin/nginxdissite
sudo chmod +x /usr/sbin/nginx*

echo adding nginx-startup script to /etc/init.d/nginx
echo adding nginx to startup

sudo wget http://splashstartplone.googlecode.com/hg/config-files/trunk/scripts/nginx-init -O /etc/init.d/nginx
chmod +x /etc/init.d/nginx
sudo update-rc.d nginx defaults
